// Underscored text generator
// Replace all spaces with an underscore.
// By Ben 23/10/2018
#include <iostream>

using namespace std;

//Get length of string
int Length(char *s){
	int i = 0;
	while (*s){
		i++;
		s++;
	}
	return i;
}

int main(int argc, char **argv) {

	char str[80];
	string s0 = "";

	std::cout << "Enter your text to convert: ";
	std::gets(str);

	for (int i = 0; i < Length
		(str); i++){
		if (str[i] == ' '){
			str[i] = '_';
		}
	}
	//Output string
	std::cout << str << endl;

	system("pause");
	return 0;
}